package _11_1;

public class _3 {
    private String xuexiao;
    private int age;
    private String name;
    private String shangke;
    private String sex;
    public int getAge() {
        return age;
    }

    public String getXuexiao() {
        return xuexiao;
    }

    public void setXuexiao(String xuexiao) {
        this.xuexiao = xuexiao;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getShangke() {
        return shangke;
    }

    public void setShangke(String shangke) {
        this.shangke = shangke;
    }

    public void setAge(int age) throws Exception {
        if (age > 22) {
            this.age = age;
        } else {
            throw new Exception("年龄大于22岁");
        }
    }
}
